const http = require("http")
const url = require("url")
const qs = require("querystring")

const server = http.createServer((req, res) => {
  console.log(url.parse(req.url));
  const { pathname, query } = url.parse(req.url)
  const { username, password } = qs.parse(query)
  res.end('end')
})
//0.0.0.0可以监听ipv4地址
server.listen(8000, '0.0.0.0', () => {
  console.log("服务器启动成功");
  console.log(server.address().port);
})